/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package scientiacluster;

import gerenciador.ClassificaBean;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import weka.IncrementalClusterer;

/**
 *
 * @author heloina
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        /*try{
            File f = new File("/root/teste.txt");
            Writer w = new FileWriter(f);
            w.write("funciona!");
            w.close();
        }catch(Exception e){
            System.err.println("Fail xD");
        }*/

        //JOptionPane.showMessageDialog(null,"Chamando o ScientiaCluster!!!");
        // TODO code application logic here
        String db_host = args[0];
        String db_user = args[1];
        String db_pass = args[2];
        String db_database = args[3];

        

        ClassificaBean fase1 = new ClassificaBean();
        String resultado = fase1.classificar(db_host, db_user, db_pass, db_database);
        if (resultado.equals("sucesso")) {
            try {
                IncrementalClusterer.main(args);
            } catch (Exception ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }

}
